package com.hgshop.yudongyang.service.impl;



import java.util.List;

import javax.annotation.Resource;

import org.apache.dubbo.config.annotation.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hgshop.yudongyang.dao.SpuMapper;
import com.hgshop.yudongyang.domain.Spu;
import com.hgshop.yudongyang.domain.SpuVo;
import com.hgshop.yudongyang.service.SpuService;
@Service
public class SpuServiceImpl implements SpuService {

	@Resource
	SpuMapper spuMapper;

	@Override
	public PageInfo<Spu> list(int pageNum, int pageSize,SpuVo vo) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		return new PageInfo(spuMapper.list(vo));
	}

	@Override
	public void dels(Integer[] ids) {
		// TODO Auto-generated method stub
		spuMapper.dels(ids);
	}

	@Override
	public void del(Integer id) {
		// TODO Auto-generated method stub
		spuMapper.del(id);
	}

	@Override
	public void add(Spu spu) {
		spuMapper.add(spu);
		
	}

	@Override
	public Spu getOne(Integer id) {
		// TODO Auto-generated method stub
		
		return spuMapper.getOne(id);
	}

	@Override
	public void update(Spu spu) {
		// TODO Auto-generated method stub
		spuMapper.update(spu);
	}

	@Override
	public List<Spu> findSpuByCatId(Integer catId) {
		// TODO Auto-generated method stub
		return spuMapper.findSpuByCatId(catId);
	}
	
	
}
